<template>
  <el-form
    :inline="true"
    :model="query"
    size="small"
  >
    <el-form-item label="组织名称">
      <el-input
        v-model="query.name"
        clearable
      />
    </el-form-item>
    <el-form-item>
      <el-button
        type="primary"
        @click="handleSearch"
      >
        查询
      </el-button>
    </el-form-item>
  </el-form>
</template>

<script>
export default {
  name: 'FilterBar',
  props: {
    query: {
      type: Object,
      default: () => {}
    }
  },
  emits: ['udate:query'],
  setup(props, { emit }) {
    const handleSearch = () => {
      emit('search', props.query)
    }

    return {
      handleSearch
    }
  }
}
</script>
